﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PorkSpleen
{
    public partial class Form1 : Form
    {
        NetServer _server;
        public Form1()
        {
            InitializeComponent();

           _server = new NetServer(this);
        }

        public void PostMessage(string message)
        {
            this.outputBox.Text = message + "\n" + this.outputBox.Text;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            _server.Setup();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            _server.Run();
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            _server.Stop();
        }
    }
}
